<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script th:inline="javascript">
        function change() {
            document.getElementById("validate").src = "getImage?random="+ Math.random();
        }
        window.onload=function(){
            change();
            var user=[[${application.user}]];
            console.log([[${application.user}]])
            console.log(user);
            console.log(user.username)
            // var username=user.split("username=")[1].split(",realname")[0];
            // var password=user.split("password=")[1].split(",sex")[0];
            document.getElementById('username').value=user.username;
            document.getElementById('password').value=user.password;
            // console.log(username,password);
        }
    </script>
</head>
<body>
<form th:action="@{/loginForm}" method="post">

    用户名：<input type="text" name="username" id="username" value=""><br>

    密&nbsp;&nbsp; 码：<input type="password" name="password" id="password" value="" ><br>

    <div class="frm"> 验证码：
        <input type="text" name="code" class="code" />
        <span>
            <img src="getImage" id="validate" onclick="change()" />
            <a href="javascript:change()">点图片点文字都可以更换验证码</a>
        </span>
    </div>

    <input type="submit" name="" value="提交" placeholder=""><br>
    <a th:href="@{/register}">注册</a>
    <p th:text="${application.msg}"></p>

</form>
<!--测试<br>
姓名<p th:text="${user?.username}"></p><br>
真实姓名姓名<p th:text="${user?.realname}"></p><br>
密码<p th:text="${user?.password}"></p><br>
性别<p th:text="${user?.sex}"></p><br>
状态<p th:text="${user?.status}"></p><br>
注册时间<p th:text="${user?.registerTime}"></p><br>-->

</body>
</html>